home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / terminal / sysline-.1 / sysline- / sysline-1.1 / README < prev    next >
Encoding:
Text File  |  1996-03-16  |  10.7 KB  |  289 lines

  1.  
  2. sysline  --  status-line display utility for Linux
  3.  
  4.  
  5. 1. INTRO
  6. --------
  7. This is a Linux port of the BSD sysline utility.  I don't know how it
  8. happened, but it sort of became my adopted child.  The original sources
  9. are included here in ./BSD.
  10.  
  11.  
  12. 2. SPARE ME THE DETAILS
  13. -----------------------
  14. cat QuickStart
  15.  
  16.  
  17. 3. INSTALL
  18. ----------
  19. The program requires presence of the /proc file-system; if you don't
  20. have it, you might consider recompiling your kernel (if you don't have
  21. a kernel, consider getting an other kind of OS first).
  22.  
  23. Run ./Configure to create Makefile and config.h.
  24. It shouldn't really be necessary to edit these any further, though there
  25. may eventually be some things you want to modify or customize.
  26.  
  27. Running `make' will compile sysline, `make install' will install
  28. sysline and sysline.1 in the paths as per the Makefile (if you install
  29. by hand, run strip on the binary first).  If you want to have `cs'
  30. installed as well (see below), edit the Makefile accordingly.
  31.  
  32. If `make' fails with an error like:
  33. ``*** commands commence before first target.  Stop.''
  34. you prob. need to remove tabs from empty lines in the Makefile
  35. (either that or get GNU make version 3.73 or later).
  36.  
  37. After having installed sysline, run the make.termcap-entry or the
  38. make.terminfo-entry script (whichever sysline was compiled for), and
  39. add the output to the relevant database (see below).
  40.  
  41.  
  42. 4. TERMCAP/TERMINFO REQUIREMENTS
  43. --------------------------------
  44. Your termcap file or terminfo file --whichever applies-- might be
  45. lacking some capabilities that sysline needs or appreciates.  Here's an
  46. overview.
  47.  
  48. The following capabilities are absolutely 100% essential:
  49.  
  50. termcap capability    terminfo equiv.  meaning
  51. ------------------    ---------------  -------
  52. hs            hs             terminal has status-line
  53. es            eslok             escapes in status-line ok
  54. ts            tsl             move to status-line
  55. fs            fsl             move from status-line
  56. ds            dsl             clear status-line
  57.  
  58.  
  59. The next capabilities are prob. already defined some place, and can be
  60. left unchanged; just check if you have them:
  61.  
  62. termcap capability    terminfo equiv.  meaning
  63. ------------------    ---------------  -------
  64. so            smso             begin standout (reverse) mode
  65. se            rmso             end standout (reverse) mode
  66. ce            el             clear to end-of-line
  67. bl            bel             audible signal (bell)
  68.  
  69.  
  70. These too are capabilities which prob. are already defined some
  71. place, but which might need modifications:
  72.  
  73. termcap capability    terminfo equiv.  meaning
  74. ------------------    ---------------  -------
  75. cs            csr         set scroll-region
  76. cl            clear         clear screen and home cursor
  77. cd            ed         clear to end-of-screen     (*
  78. cm            cup         move cursor to row, column (**
  79. ho            home         home cursor            (**
  80.                 (*  only for a top status-line
  81.                 (** only for a bottom status-line
  82.  
  83.  
  84. The following capabilities are also used, if they are defined; i2
  85. better be present when you're not using the `cs' script (see below);
  86. ws#80 can usually be omitted, unless you want to specify a shorter
  87. status-line than the screen-width:
  88.  
  89. termcap capability    terminfo equiv.  meaning
  90. ------------------    ---------------  -------
  91. i2            is2             initialization string
  92. ws#80            wsl             width of status-line
  93.  
  94.  
  95. The most convenient way of modifying termcap (or the terminfo database
  96. file) is to paste a referring entry somewhere into that file.  The
  97. make.termcap-entry and make.terminfo-entry scripts allow you to create
  98. such an entry with minimal effort.
  99. The invocation of one of these scripts will in fact output two entries:
  100. one for a status-line on the bottom line and one for a status-line on
  101. the top line of the screen.  This output is supposed to be directed to a
  102. file, which can then be pasted into the database-file at an appropriate
  103. place.  Cinch.
  104.  
  105. One note about the 'cd' capability-string.  This should really clear
  106. from the cursor to the end-of-screen (\E[J), however, what these scripts
  107. generate (\E[K) clears only to the end-of-line.  The former would
  108. temporarily erase the status-line, the latter leaves it alone, but has
  109. the side-effect that other programs may occasionally clear too little.
  110. Remedy that by commenting out this modified 'cd' (by placing a period
  111. in front of it: .cd), depending on which annoys you more.
  112. If only there were a way we could clear from the cursor to a specific
  113. position; I'm convinced there is none, but am open to suggestions, even
  114. the less elegant or more exotic ones.
  115.  
  116. Also note that the entries produced by these scripts refer to entry
  117. 'con-unk' only as an example; change to whatever is appropriate for you.
  118.  
  119.  
  120. 5. COLORIZING THE STATUS-LINE
  121. -----------------------------
  122. The status-line can be given most any color of choice by setting an
  123. environment variable SYSLINE_COLORS (or, if that's Greek to you,
  124. SYSLINE_COLOURS).
  125. This variable is expected to contain the values of attributes and
  126. colors of both the normal and the reversed status-line.
  127.  
  128. The format of its value is "rv=aa[;bb[;cc...]]:nm=zz[;yy[;xx...]]"
  129. where aa, bb, ... and zz, yy, ... each represent a color-attribute or
  130. a foreground/background-color, separated from one another by a
  131. semi-colon.  Those following "rv=" are for the reversed status-line
  132. (which it is 4 out of 5 times), those following "nm=" are for the
  133. normal un-reversed status-line (every 5th display; is this
  134. counterintuitive or what).  For clarity, the "rv=" part may be
  135. separated from the "nm=" part with any character like a blank or a
  136. colon, or... -- your chance to be creative!  The order of rv or nm is
  137. unimportant.
  138.  
  139. An example: to have a bold/blue-bg/yellow-fg status-line which
  140. becomes a bold/red-bg/white-fg status-line every fifth display do
  141. SYSLINE_COLORS="rv=1;44;33:nm=1;41;37" on that vt.
  142.  
  143. Note that all this fancy colorization of the status-line defeats the
  144. purpose of displaying this status-line in normal video, which is to give
  145. the screen a rest every 5th display thereby preventing terminal illness.
  146.  
  147. Attributes are as follows (incomplete):
  148.  
  149.     0 = all attributes off
  150.     1 = intensity 2 (bold)
  151.     2 = intensity 0 (half-bright)
  152.     4 = underline on
  153.     5 = blink on
  154.     7 = reverse on
  155.  
  156. Color codes are as follows:
  157.  
  158.     color        foreground    background
  159.     -----        ----------    ----------
  160.     black        30        40
  161.     red        31        41
  162.     green        32        42
  163.     yellow        33        43
  164.     blue        34        44
  165.     magenta        35        45
  166.     cyan        36        46
  167.     white        37        47
  168.  
  169.  
  170. 6. OPERATION
  171. ------------
  172. Each time before starting sysline you need to take some precautions
  173. to ensure that other programs don't interfere with the status-line.
  174. This may involve setting a scroll-region, but at least involves doing
  175. `stty rows N', where N is the number of rows (lines) in the scroll-
  176. region.
  177.  
  178. If you have the 'i2/is2' capability in your termcap/terminfo entry,
  179. sysline will set the scroll-region itself upon startup.  In this case
  180. the only thing you have to do before starting sysline is `stty rows N',
  181. N being 1 less than the number of lines on the terminal.
  182.  
  183. If on the other hand you have chosen to leave out or comment out the
  184. 'i2/is2' capability from the termcap/terminfo database, you also need
  185. to set the scroll-region yourself, in addition to making the stty call
  186. before starting sysline.  Enter my `cs' script: it will do both!  As
  187. arguments give it the first and last line of the scroll-region.
  188.  
  189. Note: if you're going to use `cs', you might want to modify its choice
  190. between GNU's termcap-based `tput', or ncurses' terminfo-based `tput',
  191. or none of the above; in the latter case it uses its own strings.
  192.  
  193. Example for a 80x30 terminal:
  194. ------------------------------
  195.  
  196. to add status-line:
  197.  
  198. 1. stty rows 29    (or `cs 1 30')
  199. 2. TERM=con80x30-s    (for bash, zsh; for csh: "set term=con80x30-s")
  200. 3. sysline        (will set scroll-region using the i2/is2 strings)
  201.  
  202. to remove status-line:
  203.  
  204. 1. kill -HUP <pid>    (tidy up when exiting)
  205. 2. TERM=con80x30    (for bash, zsh; for csh: "set term=con80x30")
  206. 3. stty rows 30      \    (back to full-size tty)
  207. 4. tput csr 1 30     /    (or `cs 1 30') (reset scroll-region to normal)
  208.  
  209.  
  210. 7. FURTHER NOTES AND HINTS
  211. --------------------------
  212. * To run sysline in a 1-line xterm, your termcap/terminfo database
  213.   file does not need any of the above mentioned capabilities; just
  214.   start sysline with the -w flag and resize the window any way you
  215.   like, preferably to 1 line.
  216.  
  217.   Running sysline without the -w flag in a larger xterm --which btw.
  218.   would require all the capabilities to be present in the xterm entry--
  219.   doesn't make much sense, unless you never intend to resize that
  220.   particular window.
  221.  
  222. * If you compiled sysline for terminfo and you changed the contents of
  223.   the terminfo database file, do not forget to run 'tic <terminfo_file>'
  224.   to compile that file in order to make your changes take effect.
  225.  
  226.   Analogously, if you're using sysline for termcap, and have a TERMCAP
  227.   environment variable set containing the full terminal description,
  228.   you have to actually logout or do `eval `tset -s`' to make the changes
  229.   take effect.
  230.  
  231. * To clear the screen without removing --albeit temporarily-- the
  232.   status-line, use the 'tput clear' command.
  233.  
  234.   A terminfo-based `tput' comes with the ncurses package; a termcap-
  235.   based `tput' (which accepts the same _terminfo_ capability-names as
  236.   the ncurses `tput') can be found in GNU's tput-1.0.tar.gz or the GNU
  237.   termutils-2.0 package.
  238.  
  239. * To reset the screen without it removing the status-line, you can use
  240.   the `reset' script that comes with the util-linux package, which uses
  241.   `tput' (since ncurses' terminfo-based `tput' and GNU's termcap-based
  242.   `tput' accept the same capability-names, that reset script can be
  243.   used for both).
  244.  
  245. * Want to force an update of the status-line?
  246.   Do `kill -ALRM <sysline-pid>'.
  247.  
  248. * If you run sysline as root, it may continue to run after you log out
  249.   (without the data on the status-line being updated anymore mind you).
  250.   This happens to be the case getty_ps at least (2.0.7c and later), not
  251.   with getty4.32 by Fred van Kempen; I don't know about other getty's, nor
  252.   why they behave so differently and what would be standard -- your guess
  253.   is as good as mine, probably better, which doesn't help.
  254.   Anyway, to avoid this waste of resources, you could start it thus:
  255.  
  256.                sysline -i >~/sysline.pid
  257.  
  258.   and then have so:
  259.  
  260.         if [ -e ~/sysline.pid ]
  261.         then
  262.             kill -HUP `cat ~/sysline.pid` 2>/dev/null
  263.             rm ~/sysline.pid
  264.             cs 1 25        # example 25-line terminal
  265.         fi
  266.  
  267.   in your ~/.logout file -- or something more elaborate.
  268.  
  269. * Hardscroll (Shift-PgUp/Dn) does not work on vt's with a status-line.
  270.   This is normal -- I never use it anyway.
  271.  
  272. * If programs start behaving erratically, check you termcap file for
  273.   trailing whitespace on lines which are part of an entry.  Yes.
  274.  
  275. * Individual capabilities in the termcap and terminfo databases can be
  276.   commented out by placing a period just before the capability name.
  277.  
  278.  
  279.  
  280. 8. FEEDBACK
  281. -----------
  282. Questions, bugs, comments, suggestions, flames to yours truly.
  283.  
  284. Did I say ``enjoy''?
  285.  
  286.                 BJ
  287.                 ``in the software business since tuesday''
  288.                 bjdouma@xs4all.nl (Bauke Jan Douma)
  289.